package com.zuihai.app.mvp.model;

import com.jess.arms.di.scope.FragmentScope;
import com.jess.arms.integration.IRepositoryManager;
import com.jess.arms.mvp.BaseModel;
import com.zuihai.app.mvp.contract.DetailShoppingContract;
import com.zuihai.app.mvp.model.api.service.DetailService;
import com.zuihai.app.mvp.model.entity.BaseJson;
import com.zuihai.app.mvp.model.entity.FindItem;

import javax.inject.Inject;

import rx.Observable;

/**
 * Created by Administrator on 2017/5/16 0016.
 */

@FragmentScope
public class DetailShoppingModel extends BaseModel implements DetailShoppingContract.Model {

    private DetailService mDetailService;

    @Inject
    public DetailShoppingModel(IRepositoryManager repositoryManager) {
        super(repositoryManager);
        mDetailService = repositoryManager.obtainRetrofitService(DetailService.class);
    }

    @Override
    public Observable<BaseJson<FindItem>> requestShopping(String id, String userId, int page) {
        return mDetailService.requestShopping(id, userId, page);
    }
}
